package com.fjx.sortdemo.Controller;

import com.fjx.sortdemo.entity.req.SortReq;
import com.fjx.sortdemo.entity.resp.SortResp;
import com.fjx.sortdemo.service.SortHandlerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("/sort")
public class SortController {

    private final SortHandlerService sortHandlerService;

    public SortController(SortHandlerService sortHandlerService) {
        this.sortHandlerService = sortHandlerService;
    }

    @PostMapping("/sortHandler")
    private List<SortResp> sortHandler(@RequestBody SortReq sortReq) {
        return sortHandlerService.sortHandler(sortReq);
    }
}
